<template>
  <div class="no-auth-container">
    <div class="no-auth-content">
      <div class="no-auth-icon">
        <i class="icon-lock"></i>
      </div>
      <h1 class="no-auth-title">暂无访问权限</h1>
      <p class="no-auth-desc">抱歉，您没有权限访问此页面</p>
      <div class="no-auth-actions">
        <button class="btn-primary" @click="goToHome">返回首页</button>
        <button class="btn-default" @click="goBack">返回上一页</button>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { useRouter } from "vue-router";

const router = useRouter();

const goToHome = () => {
  router.push("/");
};

const goBack = () => {
  router.go(-1);
};
</script>

<style scoped>
.no-auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #f5f7fa;
}

.no-auth-content {
  text-align: center;
  padding: 40px;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  max-width: 500px;
  width: 90%;
  margin: 0 auto;
}

.no-auth-icon {
  font-size: 64px;
  color: #f56c6c;
  margin-bottom: 24px;
}

.no-auth-title {
  font-size: 24px;
  color: #303133;
  margin-bottom: 16px;
}

.no-auth-desc {
  font-size: 16px;
  color: #606266;
  margin-bottom: 32px;
}

.no-auth-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.btn-primary {
  padding: 10px 20px;
  background-color: #409eff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #66b1ff;
}

.btn-default {
  padding: 10px 20px;
  background-color: #f4f4f5;
  color: #606266;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-default:hover {
  background-color: #e9e9eb;
}
</style>
